/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIUtilities;

import java.text.DecimalFormat;

/**
 *
 * @author Heather
 */
public abstract class StringUtilities
{
  public static String getTruncatedDecimalString(double input, int numberOfDecimals)
  {
		// DecimalFormat takes string patterns, so we need to
		// create the pattern.
		String pattern = "0.";
		for (int i = 0; i < numberOfDecimals; i++)
		{
			pattern += "0";
		}
		DecimalFormat df = new DecimalFormat(pattern);

    return "" + df.format(input);
  }

}
